Computations of Confidence Intervals for Estimates in the United States National Hospital Discharge Survey, 1979–2000

Introduction The National Hospital Discharge Survey is a primary data source for epidemiology research in the United States. To ensure that estimates are reliable, confidence intervals need to be calculated. The original survey data source is not available to the public, and the usual statistical methods are unsuitable for calculating confidence intervals. Instead, calculating confidence intervals requires using the statistical methods and relative standard errors that the U.S. National Center for Health Statistics has provided. However, the relative standard error parameters differ by hospital, patient category, and group. They also change yearly with sampling and are expressed differently before and during or after 1988. Consequently, manual computations of confidence intervals with multiple groups, diseases, and years are inefficient and prone to error. We developed a SAS program to compute confidence intervals for National Hospital Discharge Survey data from 1979 through 2000, newborns excluded. Methods We transposed 22 tables of relative standard error parameters (one for each year) into two new parameter tables that maintain the sampling designs before 1988 and during and after 1988 but are similar in overall structure. We unified all values to make each set of relative standard error parameters unique. We developed a program, COMPURSE, to search for relative standard error parameters for inputted estimates and to calculate confidence intervals. We set up an interface program for users to enter data, time period, confidence interval level, and output location; to read the relative standard error parameter tables; and to run the COMPURSE program. Results For different sets of National Hospital Discharge Survey data, COMPURSE efficiently and correctly retrieved relevant relative standard error parameters for estimates and accurately calculated relative standard errors, standard errors, and confidence intervals for annual estimates, multiple-year summaries, and average annual estimates. Conclusion The program COMPURSE helps users analyze National Hospital Discharge Survey data efficiently.


Introduction
The National Hospital Discharge Survey (NHDS) is a national probability survey designed to provide information on characteristics of inpatients discharged from nonfederal short-stay hospitals in the United States (1). The NHDS is a major data source for many health studies (2,3). Conducted annually by the U.S. National Center for Health Statistics (NCHS) since 1965, the NHDS collects data from about 270,000 inpatient records in a national sample of about 500 hospitals, which comprises about 1% of inpatients nationwide (1,4). The NHDS includes only hospitals with an average length of stay of fewer than 30 days for all patients, general hospitals, or children's general hospitals; the NHDS excludes federal, military, and Department of Veterans Affairs hospitals, hospital units of institutions (such as prison hospitals), and hospitals with fewer than six beds staffed for patient use (1).
Because of complexities in survey sampling, calculating confidence intervals (CIs) for estimates extracted from the NHDS is necessary to determine whether these estimates are reliable. The original survey data source is not available to the public, and usual statistical methods are unsuitable for this calculation. Instead, calculating confidence intervals requires using the statistical methods and relative standard errors (RSEs) that the NCHS provides. RSE measures variability in estimates and is defined as the ratio of the standard error (SE) of the estimate to the estimate itself. In 2002, the NCHS issued a CD-ROM containing all data and documentation from the 1979-2000 NHDS (4). Such information provides a convenient source for summarizing data over multiple years. This CD-ROM has four parts: 1) hospital discharge data on newborns (NEWBORN) and other than newborns (NOTNB); 2) the corresponding annual civilian population data (Excel files) from the U.S. census summarized by race, sex, and geographic region; 3) annual tables (Excel files) from which the data user can calculate CIs; and 4) documentation for these data, including instructions on how to compute these SEs and CIs from the RSE.
Even with these instructions, however, it is difficult to search the current CD-ROM for proper parameters and to calculate CIs. In 1988, the NCHS changed its methods for estimating the RSEs, making these estimates more accurate and making it simpler to calculate CIs than before 1988 (4). However, these changes cause new difficulties in summarizing estimates from 1979 through 1987 with those occurring afterward because the annual RSE parameter tables on the CD-ROM differ for these two periods in four ways ( Table 1). The first difference is that the types of statistics for hospitalizations differ in their number and form. Before 1988, three types of statistic are listed as subtables: the first-listed diagnosis or all-listed diagnoses, days of care, and procedure. Starting in 1988, four types of statistic are listed as variables: first-listed diagnoses, alllisted diagnoses, days of care, and procedure. The second difference is that the demographic characteristics or groups (e.g., male, female, race) are listed as variables before 1988 but as values of variables afterward. The third difference is that the RSE parameters are expressed as percentages from 1979 through 1987 but as function coefficients afterward. The percentage format before 1988 is unsuitable for calculating CIs on some statistical software (e.g., SUDAAN [Research Triangle Institute, Research Triangle Park, NC]) (MF Owings, NCHS, written communication, May 2003). The fourth difference is that the listed RSEs before 1988 correspond only to a few specific weighted estimates, so interpolation is necessary to compute SEs and CIs for weighted sample estimates between these listed estimates. During or after 1988, however, the RSE parameters are function coefficients that allow direct computation of SEs and CIs of any weighted sample estimate. The parameters in either type of RSE table can be applied for SE and CI computations for data reports only if the unweighted number of hospital discharges is 30 or more; otherwise, the data would not be reliable (4).
Given these difficulties, manual computations will be inefficient and prone to error, particularly for studying multiple diseases over many years. For example, calculating CIs for the annual totals of five diseases in five sociodemographic categories over 5 years would require 125 computations. The computations for these CIs are based on 125 RSE values calculated from 50 different parameters selected from RSE parameter tables. Therefore, we developed a SAS (SAS Institute Inc, Cary, NC) program that both retrieves appropriate RSE parameters corresponding to given weighted estimates and calculates SEs and CIs for annual totals, multiple-year summaries, and average annual totals of multiple years of NHDS data (excluding those for newborns). This paper describes the structure and functions of the program and presents the rationale for robust calculations of CIs.

Methods
A flow chart shows how the SAS program performs RSE retrieval and SE and CI computation ( Figure 1). The first part of the program includes a sampled hospital table from the NHDS instructions and transposes the 22 annual RSE parameter tables on the CD-ROM (4) into two new parameter tables by SAS array programming. The second part, the COMPURSE program, systematically retrieves the parameters corresponding to specified weighted estimates and automatically computes the required RSEs, SEs, and CIs. The last part of the program includes an interface for the user to provide information that allows the first two parts of the program to work.

Transposition of the parameter tables
Each NHDS annual sample is unique, and the values of the annual parameters differ by year, type of statistic, and group within each demographic category. Because the parameter formats before 1988 differ from those during and after 1988, the parameter tables for each time period were transposed separately. The 22 tables of RSE parameters (one for each year from 1979 to 2000) have been transposed with SAS array programming into two new parameter tables so that the new tables have similar overall structures. This allows the COMPURSE program to search systematically for parameters corresponding to the characteristics of the disease or condition of interest.
Before transformation, each parameter table of RSEs before 1988 contains separate subtables for the following three types of statistic: the first-listed diagnosis or all-listed diagnoses, days of care, and procedure. The parameters before 1988 are expressed as percentages of the point estimate that represent the RSE at two specific weighted estimates -the minimum and the maximum of a tabulated range. The weighted estimates are listed for the type of statistic: estimates from 5000 to 40 million for the diagnosis subtable, estimates from 10,000 to 250 million for the days-of-care subtable, and estimates from 5000 to 30 million for the procedure subtable. After transformation, within each type of statistic, RSEs are specified for characteristics or group (e.g., white, black, Asian/Pacific Islanders, type of hospital) within categories such as race, hospital, and geographic region. An "ALLOTHER" category identifies RSEs appropriate for all other hospital and patient characteristics (Table 2). Therefore, the transposed annual parameter tables are indexed by four variables: "YEAR" (year of the NHDS survey), "OUTCOME" (the type of statistic), "CATE" (demographic or geographic category), and "CHARACTE" (specific demographic characteristics or groups within each demographic category). For example, in the 1979 NHDS, the RSE for the number of hospital discharges with a specific diagnosis (i.e., a given International Classification of Diseases, Ninth Revision  Table 2).
During or after 1988, the tabled parameters are not presented as percentages but as two coefficients of a function (5) to calculate RSEs for any weighted estimate size where the unweighted number of hospital discharges is 30 or more. Each of the four types of statistic (first-listed diagnosis, all-listed diagnoses, days of care, and procedure) has its own pair of coefficients. More patient characteristics and categories (e.g., regions, sources of payment, age, sex, race) are listed during or after 1988 than were listed before; "TOTAL" is listed for overall totals and all other nonspecified categories and characteristics (Table 2). For example, the RSE for the number of hospital discharges of a specific procedure for women in 1988 would be calculated from two coefficients, 0.00332 ( (Table 2).
Because the NHDS CD-ROM tables list annual RSEs expressed as percentages for given listed estimates for years 1979 through 1987 but list function coefficients for 1988 and afterward, the COMPURSE program must compute the RSE, SEs, and CIs differently for each period (5). Although the current program is limited to the years available on the CD-ROM , other transposed parameter tables can be added by extending the existing tables beyond 2000 (4). Because there are no error curves for NHDS data from 1965 to 1978, the COMPURSE pro-  gram is unusable for data in these years. A third parameter table lists the annual number of hospitals sampled from 1965 to 2000 to compute CIs for the average annual totals of multiple-year summaries before 1988 (5).

Calculation of RSEs, SEs, and CIs
The second part of the COMPURSE program is a SAS program (version 6.12 or later) that searches for the appropriate parameter from the transformed tables and calculates the corresponding point estimates, SEs, and CIs by year, type of statistic, hospital and demographic category, and characteristics or groups ( Figure 2). Depending on year, the program distinguishes the kind of RSE parameters (percentages or function coefficients) and the characteristics with specific parameters from those without spe-cific parameters (e.g., "ALLOTHER" before 1988 or "TOTAL" during or after 1988).
COMPURSE merges user-specified data and the corresponding RSE parameter tables to look up specific values in the parameter tables. If survey year, type of statistic, category, and characteristics (group) within a category for the user-specified data agree with those from the corresponding RSE parameter tables, the program then selects the corresponding pair of parameters from the parameter tables. Before 1988, the COMPURSE program linearly interpolates between the RSE percentage values corresponding to the listed estimates above and below the weighted estimate (ESTINUM) the user specifies (5). During or after 1988, COMPURSE immediately calculates these intervals from the function coefficients selected during the table lookup for the weighted estimate (ESTINUM) the user specifies (5).
For annual totals with specified characteristics, COM-PURSE can output the number, rate, and percentage of hospital discharges with their corresponding SEs and CIs (Appendix A). COMPURSE also provides another option to compute average annual totals for multiple years and their SEs and CIs (based on the third set of transposed parameter tables for years before 1988 or the function coefficients for 1988 and thereafter). The methods for computing these latter multiple-year averages are described in the NCHS documentation for the NHDS 1979-2000 data (5).

User interface
The third part of the program, the user interface, allows the user to define the time period for multiple-year summaries, to supply the normal deviate corresponding to the significance level for the CIs, to choose units for expressing the rate and the number of hospital discharges, and to provide other parts of the program with the location of files and the type of data input and output (Figure 3; Appendix B).

Results
We tested the COMPURSE program with three data sets extracted from the NHDS, one from a publication (6) and the other two from projects on which the first author is working. The COMPURSE program was designed to perform a statistical analysis once for each disease or dis-  ease group. Analyzing multiple diseases in one program run requires the addition of SAS macro statements to the interface program. With the NHDS data cited (6)

Discussion
When reporting results from this program, the user should consider NCHS guidelines for reporting NHDS estimates. Because of the complex sample design of the NHDS, the NCHS recommends the following: 1) if an estimate is based on 29 or fewer unweighted sampled discharges, the value of the estimate should not be reported; 2) if this number is from 30 through 59, the value of the estimate may be reported but should not be considered reliable; 3) if this number is 60 or more, and if the RSE is less than 30%, the value of the estimate is reliable and may be reported; and 4) if the RSE of any estimate exceeds 30%, no matter what the number in the unweighted sample is, this estimate is unreliable and should not be reported. The NCHS further indicates that the user of the data should decide whether or not to report an estimate. However, if the user chooses to report an unreliable estimate, the user must inform the consumer (for example, a reader or a policy maker) that the estimate is unreliable (5).
If the overall number of hospital discharges for a disease of interest is small, the RSE may be relatively large. To reduce such large RSEs, the data analyst can aggregate multiple years of data to increase the number in the unweighted sample. However, such aggregation may defeat the purpose of the analysis (e.g., looking for time trends).
Finally, computations of RSEs, SEs, and CIs cannot be applied to subgroups that combine different demographic groups (e.g., white males, black females). Computations can only be applied to single-category groups such as only whites or only males (MF Owings, NCHS, written communication, May 2003). COMPURSE was programmed based on the National Hospital Discharge Survey 1979-2000 Multi-Year Public-Use Data File Documentation (5). However, it can also be used for data after 2000 as long as the RSE parameter table for these years is transposed and added to the new RSE parameter tables. Because there are no error curves for NHDS data from 1965 to 1978, the COMPURSE program is unusable for data in these years. The 1979-2000 transposed parameter tables, the COMPURSE program, and the data interface program described in this article are available from the first author, who will update and transpose parameter tables issued by NCHS for years after 2000. The program will be updated and modified to account for any discrepancies found in the future. Users who identify problems with the program or incorrect results should contact the first author.   First-or all-listed diagnosis 5,000-40,000,000 * * * Days of care 10,000-250,000,000 * * * Procedure 5,000-30,000,000  The opinions expressed by authors contributing to this journal do not necessarily reflect the opinions of the U.S. Department of Health and Human Services, the Public Health Service, the Centers for Disease Control and Prevention, or the authors' affiliated institutions. Use of trade names is for identification only and does not imply endorsement by any of the groups named above.  Ps is a ratio of the difference between the weighted estimate and the listed estimate in low side over that between listed estimates in the high side and the low side; SE_a1 and SE_a2 are SE for the listed estimates in the low side and high side, respectively, and SE is the standard error of the weighted estimate the user specified; RSE is relative standard error and CI is confidence interval; t-value is the t value at the given statistical level. where a and b are coefficients listed in the RSE parameter tables, and the other components are the same as those in the previous equation.

Appendix B. Program Instruction
For annual totals with specified given characteristics, COMPURSE can output the number, rate, and percentage of hospital discharges with their corresponding SEs and CIs. COMPURSE also provides another option to compute average annual totals for multiple years and their SEs and CIs (based on the third set of transposed parameter tables for years before 1988 or the function coefficients for 1988 and thereafter). The methods for computing these latter multiple-year averages are described in the NCHS documentation for the NHDS 1979-2000 data (5).
The COMPURSE package includes three parts: 1) three sets of transposed parameter tables and the example reference table of variables (Table 2) for data preparation; 2) the COMPURSE program for parameter retrieval and confidence interval calculation ( Figure 2); and 3) the interface program (Figure 3), which the user modifies to provide information to run the other two parts of the package.
The user should first copy all three parts of the COM-PURSE package to the user's computer. Specifically, the user should save without changes the transformed parameter tables and the COMPURSE program in a directory on the computer hard drive. The user should save a copy of the interface program under a new name for the user's current analysis and leave the original copy to be copied for next analysis.
Second, the user should change this new copy of the interface program to define the computer directory path where the RSE parameter tables and the COMPURSE program for CI computations are located. In this new copy, the user should also change the statements in brackets, optionally typing in appropriate words, or the sentences ending in ellipses. For example, to set up yearly groups in value statement of PROC FORMAT, to modify for the new copy of the interface program, or to combine multiple values in variable characteristics into a new value (cf., Figure 3).
These changes are the following: 1. The name(s) of the path(s) to the hard disk directories where the three parameter tables are located; 2. The name of the hard disk directory path for the COM-PURSE program; 3. The name(s) of the hard directory path(s), file name(s), and extension(s) for the location(s) to print the output results for either the annual totals, the average annual totals of multiple year summaries, or both. If the user wants only one of the latter sets of results, the user should comment out the location of the other set of results by typing an asterisk at the start of the corresponding line.
Third, the user must specify which of three time periods should be analyzed: 1979-1987, 1988-2000, or 1979-2000. For multiple-year summaries, the time period specified should be the same for the hospitals sampled and for the data selected. The COMPURSE program will compute SEs and CIs for average annual totals for such summaries even if the time period spans the transition period 1987-1988.
Fourth, the user can specify a confidence level for the Cl different from the default (95%) by typing an ampersand (&) and either of two other options, t90 (90% level) or t99 (99% level), after the macro variable, &tt. The user can also specify different options for saving the output results of hospital discharges and for changing the magnitude of rates by selecting denominators for the rate (DNR&[any of the listed names of the numbers]) or for the number (DNO&[any of the listed names of the numbers] or for both.
Fifth, the user should input the extracted data, with the following restriction: the COMPURSE program processes the relevant estimates, their SEs, and their CIs only for one disease or disease group at a time; however, the user may write a macro in the user interface program to compute SEs and CIs for more than one disease or disease group at a time.
The user's extracted data should include both diseases and years of interest from the NHDS CD-ROM  and the annual weighted sample estimates of hospital discharges by specified characteristics in separate external files accessible by SAS. These data may be input through SAS and include two more variables. The first step is to determine what type of statistic the user is interested in -first-listed diagnosis, all-listed diagnoses, procedure, or days of care. The second is to define the category for the characteristics. The RSE parameter table (Table  2) will be helpful for selecting these types of statistic and characteristics. For example, if the user were interested in the first-listed diagnosis of hospitalizations among those aged >15 years, the value of the first variable for the type of statistic (OUTCOME) should be "FDX" (first-listed diagnosis), and the values of the second variable (characteristic for the type of statistic) for the category variable (CATE) should be "AGE." Although the user can name variables in the input file in the desired way, the program uses a standard set of variable names. The user should type in the data variable names from the right side of the assignment statements for the type of statistic and their characteristics (the words in the brackets of the interface program, cf., Figure 3). The program uses the standard variable names on the left side of these assignment statements. For example, if the variable name representing the survey year in the user's data is "YR," the user should fill in the bracket on the right side of the assignment statement with YR. If the variable name representing the weighted estimate of hospitalizations in the user's data is "weitnum," the user should fill in the bracket on the right side of the assignment statement with WEITNUM. If the user does not want to compute a rate, the user can fill in the bracket with a period (SAS's missing value indicator). The unweighted estimate (unweighted number of discharges) is named as "CASENUM" in the program. The user should calculate this number and include it on the input file. The computations of CIs are conducted only if the unweighted estimate is >30. If some characteristics have too few hospital discharges to be observed individually, they can be summarized as a new value under the variable name CHARACTE (characteristics). The new character value should not have the same name as any of the other values in the assignment statements mentioned previously. Finally, the user should remove all the brackets from the modified copy of the user interface program before running the program.
After specifying the NCHS data set of interest and any of the previous options, the user can submit the copy of the user interface program through SAS. This interface program in turn calls the COMPURSE program through the %INCLUDE &COMPURSE statement to calculate the estimates and their RSEs, SEs, and CIs.